# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor:  Hyacinthe Cartiaux <hyacinthe.cartiaux at free.fr>
# Contributor: Bartlomiej Piotrowski <nospam at bpiotrowski dot pl>
# Contributor: Patrick McCarty <pnorcks at gmail dot com>

pkgname=discount
pkgver=2.2.4
pkgrel=1
pkgdesc='A Markdown implementation written in C'
arch=(x86_64)
url="https://www.pell.portland.or.us/~orc/Code/discount/"
license=('custom:BSD')
source=("http://www.pell.portland.or.us/~orc/Code/$pkgname/$pkgname-$pkgver.tar.bz2")
sha256sums=('74fd1e3cc2b4eacf7325d3fd89df38b589db60d5dd0f4f14a0115f7da5e230a5')
depends=(glibc)
conflicts=(markdown)
provides=(markdown)
replaces=(markdown)

build() {
  cd $pkgname-$pkgver
  ./configure.sh --prefix=/usr --enable-all-features --with-fenced-code --shared
  make
}

package() {
  cd $pkgname-$pkgver
  # fix ldconfig call
  sed -e 's|/sbin/ldconfig|/sbin/ldconfig -n|' -i librarian.sh

  make DESTDIR="$pkgdir" install.everything
  install -Dm644 COPYRIGHT "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
